package br.diego.tb.unknown;

public class NthPermutation 
{
    public static int[] nth_perm(Integer[] v, Integer n) 
    {
    	int[] permutatted = new int[v.length];
    	
    	for(int i = 0; i < v.length; i ++)
    	{
    		int newPosition = (n + i) % v.length;
    		permutatted[newPosition] = v[i];
    	}
    	
    	for(int value : permutatted)
    	{
    		System.out.println(value);
    	}

    	return permutatted;
    
    }
}
